package com.kaifamiao.thread.d0928.pm;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

public class Demo {

    public static void main(String[] args) {
        try {
//            InetAddress localHost = InetAddress.getLocalHost();
            InetAddress address = InetAddress.getByName("DESKTOP-JH0P9SP");
            System.out.println(address);
            System.out.println(address.getHostAddress());
            System.out.println(address.getHostName());
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }
}
